/*
 * Famon (http://code.google.com/p/famon/)
 * Copyright (c) 2010 Carl Crous.
 *
 * This file is part of Famon.
 *
 * Famon is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Famon is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Famon.  If not, see <http://www.gnu.org/licenses/>.
 */

package za.org.foobar.famon.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * A thread identifier for a failure
 */
public class CThreadInformation implements Serializable {

    private String name;
    private List<CStackTraceElement> stackTrace;
    private List<CLoggingEvent> loggingEvents;

    public CThreadInformation() {
        stackTrace = new ArrayList<CStackTraceElement>();
        loggingEvents = new ArrayList<CLoggingEvent>();
    }

    public CThreadInformation(String name) {
        this.name = name;
    }

    public CThreadInformation(String name, List<CStackTraceElement> stackTrace, List<CLoggingEvent> loggingEvents) {
        this.name = name;
        this.stackTrace = stackTrace;
        this.loggingEvents = loggingEvents;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<CStackTraceElement> getStackTrace() {
        return stackTrace;
    }

    public void addStackTraceElement(CStackTraceElement element) {
        stackTrace.add(element);
    }

    public List<CLoggingEvent> getLoggingEvents() {
        return loggingEvents;
    }

    public void addLoggingEvent(CLoggingEvent event) {
        loggingEvents.add(event);
    }

    public void setStackTrace(List<CStackTraceElement> stackTrace) {
        this.stackTrace = stackTrace;
    }

    public void setLoggingEvents(List<CLoggingEvent> loggingEvents) {
        this.loggingEvents = loggingEvents;
    }
}
